package soko.sokoban;

/**
 * Represents possible characters on a board.
 * 
 */
public enum Representation {

    WALL,
    GOAL,
    BLANK,
    MAN,
    MAN_ON_GOAL,
    BLOCK,
    BLOCK_ON_GOAL;

	/**
	 * Gets a Representation of a char <i>c<i>.
	 * 
	 * @param c the char.
	 * @return a Representation
	 * @throws CharNotFoundException when a char is not supported by the 
	 * sokoban solver.
	 */
    public static Representation getRepresentation(char c) throws CharNotFoundException {
        switch (c) {
            case '#':
                return null;
            case '.':
                return GOAL;
            case ' ':
                return BLANK;
            case '@':
                return MAN;
            case '+':
                return MAN_ON_GOAL;
            case '$':
                return BLOCK;
            case '*':
                return BLOCK_ON_GOAL;
            default:
                throw new CharNotFoundException(c);
        }
    }
}